<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>特征点查询</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<%@ include file="../jslib/jquerylib.jsp" %>
	<link rel="stylesheet" type="text/css" href="<%=path %>/web/style/layout.css" />
	<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/lhgdialog/lhgcore.lhgdialog.min.js?skin=mac"></script>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/demo.css">
	<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>	
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	

  </head>
  
  <body>
  	  <div style='float:left;text-align:center;'>
  		<h2>关键字查询</h2><br/>
		<table>
	     	<tr>
	     		<td>字段名称</td>
	     		<td><select class="easyui-combobox"  name="fieldname1" 
	     		id="fieldname1"  data-options="valueField:'id',textField:'text',
	     		multiple:false,panelHeight:'auto'" 
	     		url='<%=request.getContextPath()%>/searchAction!getFieldname1s.action'  
	     		style="width:250px;height: 26px;">
			    </select>
			   	</td>
	     	</tr>
	     	<tr>
	     		<td>关键字</td>
	     		<td>
	     			<input type='text' id='keyword1' name='keyword1' style="width:250px;height: 26px;"/>
			   	</td>
	     	</tr>
	     </table>	
  	</div>
  	<div style='text-align:center;'>
  		<h2>选择查询</h2><br/>
		<table>
	     	<tr>
	     		<td>字段名称</td>
	     		<td><select class="easyui-combobox"  name="tablename" 
	     		id="tablename"  data-options="valueField:'id',textField:'text',
	     		multiple:false,panelHeight:'auto',onSelect:selecttablechange" 
	     		url='<%=request.getContextPath()%>/searchAction!getTablenames.action'  
	     		style="width:250px;height: 26px;" >
			    </select>
			   	</td>
	     	</tr>
	     	<tr>
	     		<td>字典表</td>
	     		<td>
	     		<input id="fieldname2" name="fieldname2" class="easyui-combobox"  style="width:250px;height: 26px;"
			name="language"
			data-options="
					url:'combobox_data1.json',
					method:'get',
					valueField:'id',
					textField:'text',
					multiple:true,
					panelHeight:'auto'
			">

			   	</td>
	     	</tr>
	     </table>
  	</div>
	<div style='float:left;text-align:center;'>
  		<h2>区间查询</h2><br/>
		<table>
	     	<tr>
	     		<td>字段名称</td>
	     		<td><select class="easyui-combobox"  name="fieldname1" 
	     		id="fieldname1"  data-options="valueField:'id',textField:'text',
	     		multiple:false,panelHeight:'auto'" 
	     		url='<%=request.getContextPath()%>/searchAction!getFieldname1s.action'  
	     		style="width:250px;height: 26px;">
			    </select>
			   	</td>
	     	</tr>
	     	<tr>
	     		<td>关键字</td>
	     		<td>
	     			<input type='text' id='keyword1' name='keyword1' style="width:250px;height: 26px;"/>
			   	</td>
	     	</tr>
	     </table>	
  	</div>
  	<div style='text-align:center;'>
  		<h2>日期查询</h2><br/>
		<table>
	     	<tr>
	     		<td>字段名称</td>
	     		<td><select class="easyui-combobox"  name="tablename" 
	     		id="tablename"  data-options="valueField:'id',textField:'text',
	     		multiple:false,panelHeight:'auto',onSelect:selecttablechange" 
	     		url='<%=request.getContextPath()%>/searchAction!getTablenames.action'  
	     		style="width:250px;height: 26px;" >
			    </select>
			   	</td>
	     	</tr>
	     	<tr>
	     		<td>字典表</td>
	     		<td>
	     		<input id="fieldname2" name="fieldname2" class="easyui-combobox"  style="width:250px;height: 26px;"
			name="language"
			data-options="
					url:'combobox_data1.json',
					method:'get',
					valueField:'id',
					textField:'text',
					multiple:true,
					panelHeight:'auto'
			">

			   	</td>
	     	</tr>
	     </table>
  	</div>

  	<table width="100%" border="0" align="center" cellpadding="5" cellspacing="5" class="formTableNew">
  		    <tr>
  		    	<td align="center"><input id="btnsearch" type="button" value="查 询" class="form_bt_orange" onclick="searchguanduan()" /></td>
  		    </tr>
  	</table>
  	
  	<script type='text/javascript'>
  		var api = frameElement.api, W = api.opener;
		function selecttablechange(param){
			var tableid = param.id;
			$('#fieldname2').combobox({ url:'<%=request.getContextPath()%>/searchAction!getFieldname2s.action?tablename='+tableid, valueField:'id', textField:'text'});
		}
		
		function searchguanduan(){
			if($('#fieldname1').combobox('getValue')!=''){
				var fieldname1value = document.getElementById("keyword1").value;
				if (fieldname1value!=''){
					W.refreshtreebykey($('#fieldname1').combobox('getValue'),fieldname1value);
					api.close();
				}
				else{
					alert('请填写查询条件！');
				}
			}
			
		}
	</script>
  </body>
</html>
